import { defineStore } from 'pinia'

export const useUserInfo = defineStore({
  id: 'userInfo',
  state: () => ({
    isAttention: false, // 用于判断是否关注校长
    userInfo: null, // 用户信息
    token: '', // token
    unionId: '',
  }),
  getters: {
    doubleCount: (state) => state.counter * 2
  },
  actions: {
    settAttention(attention) {
      this.isAttention = attention
    },
    setUserInfo(userInfo) {
      this.userInfo = userInfo
    },
    setToken(token) {
      this.token = token
    },
    setUnionId(unionId) {
      this.unionId = unionId
    }
  }
})
